package com.ayanami.userservice.controller;


import com.ayanami.userservice.entity.TbDepartment;
import com.ayanami.userservice.service.TbDepartmentService;
import com.ayanami.utilscommon.response.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ayanami
 * @since 2020-07-27
 */
@Api("部门操作")
@RestController
@RequestMapping("/userservice/tb-department")
@CrossOrigin
public class TbDepartmentController {
    @Autowired
    private TbDepartmentService tbDepartmentService;
    @ApiOperation(value = "部门查询",notes = "ddd")
    @GetMapping("/findDept")
    public Result findDept(){
        List<TbDepartment> list = tbDepartmentService.list();
        return Result.ok().data("departmentList",list);
    }
}

